
Partial Class SAD_SQCTable
    Inherits System.Web.UI.Page

    Private msSourcePath As String = ""
    Private msTargetPath As String = ""

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim lSOID As Long = Request.QueryString("SO")
        Dim lSRID As Long = Request.QueryString("SR")
        Dim lTOID As Long = Request.QueryString("TO")
        Dim lTRID As Long = Request.QueryString("TR")

        '---Get source database and server info
        Dim oSTable As New SQLAutoDocLib.Table(lSOID, lSRID)
        oSTable.Load()

        Dim oSOwner As New SQLAutoDocLib.Login(oSTable.OwnerID)
        oSOwner.Load()

        Dim lSDatabaseID As Long = oSTable.DatabaseID
        Dim oSDatabase As New SQLAutoDocLib.Database(lSDatabaseID)
        oSDatabase.Load()

        Dim lSServerID As Long = oSDatabase.ServerID
        Dim oSServer As New SQLAutoDocLib.Server(lSServerID)
        oSServer.Load()

        msSourcePath = "SQTableD.aspx?S=" & lSServerID & "&D=" & lSDatabaseID & "&O=" & lSOID & "&R=" & lSRID & "&F=1"

        '---Get target database and server info
        Dim oDTable As New SQLAutoDocLib.Table(lSOID, lSRID)
        oDTable.Load()

        Dim lDDatabaseID As Long = oDTable.DatabaseID
        Dim oDDatabase As New SQLAutoDocLib.Database(lDDatabaseID)
        oDDatabase.Load()

        Dim lDServerID As Long = oDDatabase.ServerID
        Dim oDServer As New SQLAutoDocLib.Server(lDServerID)
        oDServer.Load()

        txtTable.InnerText = oSOwner.Login & "." & oSTable.Name
        txtSServer.InnerText = "Server: " & oSServer.Name
        txtSDatabase.InnerText = "Database: " & oSDatabase.Name

        txtTServer.InnerText = "Server: " & oDServer.Name
        txtTDatabase.InnerText = "Database: " & oDDatabase.Name

        msTargetPath = "SQTableD.aspx?S=" & lDServerID & "&D=" & lDDatabaseID & "&O=" & lTOID & "&R=" & lTRID & "&F=1"
    End Sub

    Protected Function SourcePath() As String
        Return msSourcePath
    End Function

    Protected Function TargetPath() As String
        Return msTargetPath
    End Function
End Class
